//引入axios实例
import request from "@/utils/request"

//1.登录请求
//参数类型
export interface reqLoginParamsType {
    username:string;
    password: string;
}
//返回值类型
export interface reqLoginReturnType {
    token: string;
}
//登录请求api
export const requestLogin = (userInfo:reqLoginParamsType) => {
    return request.post<any , reqLoginReturnType>(`/admin/acl/index/login` , userInfo)
}

//2.用户信息请求
//返回值类型
export interface reqUserInfoReturnType {
    routes: string[];
    buttons: string[];
    roles: string[];
    name: string;
    avatar: string;
}
//用户信息请求api
export const requestUserInfo = () => {
    return request.get<any , reqUserInfoReturnType>(`/admin/acl/index/info`)
}

//3.退出登录请求
//退出登录请求api
export const requestLogout = () => {
    return request.post<any , null>(`/admin/acl/index/logout`)
}